:root {
    --bg: #f5f7fa;
    --card: #fff;
    --muted: #6b7280;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --border: #e5e7eb;
    --shadow: rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 16px;
    width: 720px;
    background: var(--bg);
    color: #111827;
    line-height: 1.5;
}

.app {
    height: 460px;
}

.app header {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.app header h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 700;
    color: #1f2937;
}

button {
    cursor: pointer;
    border: 0;
    background: var(--accent);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

button.ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

button.ghost:hover {
    background: rgba(59, 130, 246, 0.08);
    transform: none;
}

.board {
    display: flex;
    gap: 12px;
    height: 100%;
    margin-top: 12px;
    overflow: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.board::-webkit-scrollbar {
    height: 8px;
}

.board::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
}

/* 列 column */
.column {
    width: 300px;
    min-width: 220px;
    background: linear-gradient(180deg, #ffffff, #f9fafb);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    flex-direction: column;
    max-height: 480px;
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}

/* .column:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
} */

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.column-title {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.column-actions {
    display: flex;
    gap: 4px;
}

.column-actions button {
    background: transparent;
    color: var(--muted);
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 12px;
}

.column-actions button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4b5563;
    transform: none;
}

.add-card {
    margin-top: 12px;
    background: transparent;
    color: var(--accent);
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
    border: 1px dashed rgba(59, 130, 246, 0.3);
}

.add-card:hover {
    background: rgba(59, 130, 246, 0.08);
    border-style: solid;
    transform: none;
}

/* 卡片 card */
.tasks-wrap {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    min-height: 40px;
    padding: 6px;
}

.tasks-wrap::-webkit-scrollbar {
    width: 6px;
}

.tasks-wrap::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}

.card {
    background: var(--card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px var(--shadow);
    cursor: grab;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 8px var(--shadow);
    transform: translateY(-1px);
}

.card.dragging {
    opacity: 0.6;
    transform: rotate(3deg) scale(1.02);
    border: 1px dashed var(--accent);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1f2937;
}

.card-desc {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.4;
}

.card .ghost {
    font-size: 12px;
    padding: 4px 8px;
}

/* 空占位提示 */
.placeholder {
    padding: 16px;
    border: 2px dashed rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    text-align: center;
    color: var(--muted);
    margin-bottom: 8px;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.02);
}

/* footer */
footer {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    padding-bottom: 12px;
    border-top: 1px solid var(--border);
}

footer .hint {
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
}

#clear-btn {
    background: var(--danger);
}

#clear-btn:hover {
    background: var(--danger-hover);
}

/* 模态 */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 380px;
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.25);
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.modal:not(.hidden) .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
    color: #1f2937;
}

.modal-content label {
    display: block;
    margin: 12px 0;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    resize: vertical;
    margin-top: 4px;
    transition: border-color 0.2s ease;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

#cancel-task-btn {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

#cancel-task-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4b5563;
}

#save-task-btn {
    background: var(--success);
}

#save-task-btn:hover {
    background: #059669;
}